<!DOCTYPE html>
<html> 
    <head>
        <meta charset="utf-8">
        <script src="MyAjax2.js"></script>
        <script>
            window.onload=function(ev){
                var oBtn=document.querySelector("button");
                oBtn.onclick=function(ev1){
                    ajax("POST","../statics/ajax_info.php",{
                        "userName":"国junquan",
                        "userPwd":"30312"
                    },
                    300,
                    function(xmlhttp){
                        alert(xmlhttp.responseText);
                    },
                    function(xmlhttp){
                        alert(xmlhttp.status);
                    });
                }       
            }
        </script>
    </head>
    <body>
        <button>
            发送请求
        </button>
    </body>
</html>